﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    public class RenQianKaoCha
    {
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private int _Sec;
        [DataMember]
        public int Sec
        {
            get { return _Sec; }
            set { _Sec = value; }
        }
        private int _PublicOfficialRecordID;
        [DataMember]
        public int PublicOfficialRecordID
        {
            get { return _PublicOfficialRecordID; }
            set { _PublicOfficialRecordID = value; }
        }

        private string _Memo;
        [DataMember]
        public string Memo
        {
            get { return _Memo; }
            set { _Memo = value; }
        }

        private string _Duty;
        [DataMember]
        public string Duty
        {
            get { return _Duty; }
            set { _Duty = value; }
        }

        private string _EmpName;
        [DataMember]
        public string EmpName
        {
            get { return _EmpName; }
            set { _EmpName = value; }
        }

        public static RenQianKaoCha FillEntity(DataRow dr)
        {
            RenQianKaoCha right = new RenQianKaoCha();
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) right.Sec = Convert.ToInt32(dr["Sec"]);
            if (!string.IsNullOrEmpty(dr["ID"].ToString())) right.ID = Convert.ToInt32(dr["ID"]);
            if (!string.IsNullOrEmpty(dr["PublicOfficialRecordID"].ToString())) right.PublicOfficialRecordID = Convert.ToInt32(dr["PublicOfficialRecordID"]);

            right.Memo = dr["Memo"] as string;
            right.Duty = dr["Duty"] as string;
            right.EmpName = dr["EmpName"] as string;
            return right;
        }
    }
}
